package LeetcodeTest_eighteen;
//制造字母异位词
public class minSteps
{
    public static void main(String[] args)
    {
        String s="anagram";
        String t="mangaar";
        System.out.println(solution.minSteps(s,t));
    }
}
class solution
{
    public static int minSteps(String s, String t)
    {
        int i;
        int count=0;
        int numOfLetter_s[]=new int[26];
        int numOfLetter_t[]=new int[26];
        for(i=0;i<s.length();i++)
        {
            numOfLetter_s[s.charAt(i)-'a']++;
        }
        for(i=0;i<t.length();i++)
        {
            numOfLetter_t[t.charAt(i)-'a']++;
        }
        for(i=0;i<26;i++)
        {
            if(numOfLetter_s[i]>=numOfLetter_t[i])
            {
                count = count + numOfLetter_s[i] - numOfLetter_t[i];
            }
        }
        return count;
    }
}